{{template "base/base.html" .}}
{{define "head"}}<title>{{.ProName}} - Go Walker</title>{{end}}
{{define "body"}}
<div>
	<span id="lang" class="hide">{{.Lang}}</span>
	{{template "base/alert.html" .}}

	{{if .IsRefresh}}
	<div class="alert alert-success">
		<button type="button" class="close" data-dismiss="alert">&times;</button>
    	{{if eq .Lang "en-US"}}
		<strong>Congratulations!</strong>
		You successfully refreshed this project documentation at <i>{{.UtcTime}}</i>!
		{{else if eq .Lang "zh-CN"}}
		<strong>恭喜！</strong>
		您成功于 <i>{{.UtcTime}}</i> 刷新了本项目文档！
		{{end}}
	</div>
	{{end}}

	{{if .IsGoRepo}}
	<div class="alert alert-info">
		<button type="button" class="close" data-dismiss="alert">&times;
		</button>
    	{{if eq .Lang "en-US"}}
		<strong>Information!</strong>
		AstaXie launched an open source program that provides <span class="label label-info">examples</span> for every function of <strong>Go Standard Library</strong>, you shouldn't miss this great project: <a target="_blank" href="https://github.com/astaxie/gopkg/tree/master/{{.ImportPath}}" class="label label-success">gopkg</a>.
		{{else if eq .Lang "zh-CN"}}
		<strong>友情提示：</strong>
		Asta谢 在 github 上发起了 <strong>Go </strong> 标准库函数 <span class="label label-info">示例</span> 项目，每个函数都有相应操作示例，您绝对不容错过！点击这里访问：<a target="_blank" href="https://github.com/astaxie/gopkg/tree/master/{{.ImportPath}}" class="label label-success">gopkg</a>.
		{{end}}
	</div>

	<div class="alert alert-info">
		<button type="button" class="close" data-dismiss="alert">&times;
		</button>
    	{{if eq .Lang "en-US"}}
		<strong>Prompt!</strong>
		The following link will redirect to raw search for keyword <strong><a rel="nofollow" href="/search?q={{.ImportPath}}">{{.ImportPath}}</a></strong>.
		{{else if eq .Lang "zh-CN"}}
		<strong>温馨提示</strong>
		如果您想要使用与标准库重名的关键字进行搜索，请单击此链接：<strong><a rel="nofollow" href="/search?q={{.ImportPath}}">{{.ImportPath}}</a></strong>.
		{{end}}
	</div>
	
	{{else}}
	{{template "tpl/labelmodal.tpl" .}}
	{{end}}

	<div id="main_content" class="row">
		<div class="col-xs-12 col-md-12">
			{{template "tpl/exammodal.tpl" .}}

			<div id="sidebar" class="span3 hide" style="position:fixed; margin-left: -220px; top: 70px;">
				<ul class="nav nav-tabs nav-stacked affix bs-docs-sidenav">
					<li>
						<a href="#"><i class="icon-chevron-right"></i>{{i18n .Lang "Top"}}</a>
					</li>
					
					{{if .IsHasExports}}
					<li>
						<a href="#_index"><i class="icon-chevron-right"></i>{{i18n .Lang "Index"}}</a>
					</li>
					{{end}}
					
					{{if .IsHasConst}}
					<li>
						<a href="#_constants"><i class="icon-chevron-right"></i>{{i18n .Lang "Constants"}}</a>
					</li>
					{{end}}

					{{if .IsHasVar}}
					<li>
						<a href="#_variables"><i class="icon-chevron-right"></i>{{i18n .Lang "Variables"}}</a>
					</li>
					{{end}}
					
					{{if .IsHasExams}}
					<li>
						<a href="#_exams"><i class="icon-chevron-right"></i>{{i18n .Lang "Examples"}}</a>
					</li>
					{{end}}

					{{if .IsCmd}}
					{{else}}
					<li>
						<a href="#example_modal" data-toggle="modal"><i class="icon-chevron-right"></i>{{i18n .Lang "Add examples"}}</a>
					</li>
					{{end}}
					
					{{if .IsHasSubdirs}}
					<li>
						<a href="#_subdirs"><i class="icon-chevron-right"></i>{{i18n .Lang "Directories"}}</a>
					</li>
					{{end}}
					
					<li>
						<a href="#_bottom"><i class="icon-chevron-right"></i>{{i18n .Lang "Bottom"}}</a>
					</li>
					
					{{if .IsHasExports}}
					<li>
						<a href="#search_exports" data-toggle="modal"><i class="icon-chevron-right"></i>{{i18n .Lang "Search Exports"}}</a>
					</li>
					{{end}}
					
<!--
					{{if .IsGoRepo}}
					{{else}}
					<li>
						<a href="#label_modal" data-toggle="modal"><i class="icon-chevron-right"></i>{{i18n .Lang "Labels"}}</a>
					</li>
					{{end}}
-->
				</ul>
			</div>

			<div>
				<div id="project_nav" style="background-color: #f5f5f5">
					<a title="{{i18n .Lang "View this project on %s" .VCS}}" target="_blank" href="http://{{.ProPath}}" class="label label-info">{{.VCS}}</a> 
					
					<a target="_blank" href="http://{{.ProPath}}">
						<strong>{{.ProName}}:</strong>
					</a> 

					<a href="/{{.ProDocPath}}">{{.ProDocPath}}</a><span class="muted">/{{.ProName}}</span>
					<span class="pull-right">
						<span>{{i18n .Lang ".You are No.<b>%v</b> visitor of this page." .Views | str2html}}</span>
						<span class="muted"> | </span>
						<a href="#_index">{{i18n .Lang "Index"}}</a>
						
						{{if .IsHasFiles}}
						<span class="muted"> | </span>
						<a href="#_files">{{i18n .Lang "Files"}}</a>
						{{end}}
						
						{{if .IsHasSubdirs}}
						<span class="muted"> | </span>
						<a href="#_subdirs">{{i18n .Lang "Directories"}}</a>
						{{end}}
					</span>
				</div>

				<h2>
					{{if .IsCmd}}Command{{else if .IsHasFiles}}Package{{else}}Project{{end}}

					{{.ProName}} 
					
					<span class="label label-inverse label-sm">{{i18n .Lang "Rank"}}: {{.Rank}}</span>
					
                    {{if .IsHasFiles}}
                    {{if .IsHasHv}}
                    <a class="label label-danger label-sm" href="#_files">{{i18n .Lang "Hacker View"}}</a>
                    {{end}}
                    {{end}}

                    {{if .IsCgo}}
                    <span class="label label-danger label-sm">CGO</span>
                    {{end}}

                    {{if .IsCmd}}
                    {{if not .IsCgo}}
					<a target="_blank" href="https://gobuild.io/download/{{.ImportPath}}" class="label label-info label-sm">GoBuild</a>
					{{end}}
                    {{end}}

					{{range .Labels}}
					<a target="_blank" href="/label#{{.}}" class="label label-inverse label-sm">{{.}}</a>
					{{end}}
            		<g:plusone></g:plusone>
				</h2>

				{{if .IsCmd}}
				{{else}}
				{{if .IsHasFiles}}
				<div style="min-height: 25px;">
					<code>import "{{.ImportPath}}"</code>
					
					{{if isHasEleS .Tags}}
					<strong>Documentation Tags: </strong>
					<div class="btn-group">
					    <button class="btn-default dropdown-toggle" data-toggle="dropdown">{{.CurTag}} <span class="caret"></span></button>
					    <ul class="dropdown-menu">
						{{$importPath := .ImportPath}}
					    	{{range .Tags}}
					    	<li><a rel="nofollow" href="/{{$importPath}}?tag={{.}}">{{.}}</a></li>
					    	{{end}}
					    </ul>
				    </div>
					{{end}}
				</div>
				{{end}}
				{{end}}

				{{$timestamp := .Timestamp}}
				{{if .IsHasReadme}}
				<br>
				<div id="readme" class="readme"><script type="text/javascript" src="{{.PkgDocPath}}?={{$timestamp}}"></script></div>
				<br>
				{{end}}

				<div id="markdown" class="markdown">
					{{range .DocJS}}
					<script type="text/javascript" src="{{.}}?={{$timestamp}}"></script>
					{{end}}
				</div>
				
				<p>
    				{{if eq .Lang "en-US"}}
					{{if .IsHasFiles}}
					Package <b>{{.ProName}}</b> imports 
					{{if .IsHasImports}}
					<a rel="nofollow" href="/search?q={{.ImportPath}}&t=imports&pid={{.Pid}}&tag={{.CurTag}}">{{.ImportPkgNum}} packages</a>
					{{else}}
					0 packages
					{{end}}

					{{if .IsImported}} 
					and imported by <a rel="nofollow" href="/search?q={{.ImportPath}}&t=refs&pid={{.Pid}}">{{.ImportedNum}} packages</a>
					{{end}}.
					{{end}}

					Go Walker generated this page <i>{{.TimeSince}}</i>. <a class="btn-default" href="/refresh?q={{.ImportPath}}">Refresh</a>
					{{else if eq .Lang "zh-CN"}}
					{{if .IsHasFiles}}
					项目 <b>{{.ProName}}</b> 共计导入 
					{{if .IsHasImports}}
					<a rel="nofollow" href="/search?q={{.ImportPath}}&t=imports&pid={{.Pid}}&tag={{.CurTag}}">{{.ImportPkgNum}} 个外部包</a>
					{{else}}
					0 个外部包
					{{end}}

					{{if .IsImported}}
					，并且有 <a rel="nofollow" href="/search?q={{.ImportPath}}&t=refs&pid={{.Pid}}">{{.ImportedNum}} 个包</a> 引用了该项目
					{{end}}。 
					{{end}}

					Go Walker 在 <i>{{.TimeSince}}</i> 生成了此页面. <a class="btn-default" rel="nofollow" href="/refresh?q={{.ImportPath}}">刷新文档</a>
					{{end}}
				</p>
			</div>
		</div>
	</div>
</div>
{{end}}
